import {createStore} from 'redux'

const defaultState = {
    playSongInfo:{
        id:0,
        name:'请选择播放歌曲',
        al:{
            id:0,
            name:'请选择播放歌曲',
            picUrl:'http://s4.music.126.net/style/web2/img/default/default_album.jpg',
        }
    },
    lyric:[''],
    lyricTime:[]

}

const reducers = function(state=defaultState,action){
    const {type,data}=action
    switch(type){
        case 'SONG_ADD':
            // console.log(data);
            state.playSongInfo=data
            break;
        case 'LYRIC_ADD':
            state.lyric=data;
            break;
        case 'LYRICTIME_ADD':
            state.lyricTime=data;
            break;
    }
    return state;
}


const store = createStore(reducers);

export default store;